]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
recorder: Rewrite switch statement
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 23 Sep 2015 18:43:42 +0000 (20:43 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 23 Sep 2015 19:32:49 +0000 (21:32 +0200)
Avoid compiler warnings about unhandled enum values by using a
regular if-else statement.

src/shell-recorder.c

index b28e1e91e2d444a09ff05a02e475e7993873c4ea..e6d43778f93b3b4e7a60c717b9dbef83c3429b83 100644 (file)
@@ -1182,23 +1182,20 @@ recorder_pipeline_bus_watch (GstBus     *bus,
 {
   RecorderPipeline *pipeline = data;
 
-  switch (message->type)
+  if (message->type == GST_MESSAGE_EOS)
     {
-    case GST_MESSAGE_EOS:
       recorder_pipeline_closed (pipeline);
       return FALSE; /* remove watch */
-    case GST_MESSAGE_ERROR:
-      {
-        GError *error;
-
-        gst_message_parse_error (message, &error, NULL);
-        g_warning ("Error in recording pipeline: %s\n", error->message);
-        g_error_free (error);
-        recorder_pipeline_closed (pipeline);
-        return FALSE; /* remove watch */
-      }
-    default:
-      break;
+    }
+  else if (message->type == GST_MESSAGE_ERROR)
+    {
+      GError *error;
+
+      gst_message_parse_error (message, &error, NULL);
+      g_warning ("Error in recording pipeline: %s\n", error->message);
+      g_error_free (error);
+      recorder_pipeline_closed (pipeline);
+      return FALSE; /* remove watch */
     }
 
   /* Leave the watch in place */